package utils;

import com.hwangjr.rxbus.RxBus;

public final class BusUtils {

    private BusUtils() {
    }

    public static void register(Object subscriber) {
        if (subscriber == null) {
            return;
        }
        try {
            RxBus.get().register(subscriber);
        } catch (IllegalArgumentException e) {
//            BuglyWrapper.getInstance().postException(e);
        }

    }

    public static void unregister(Object subscriber) {
        if (subscriber == null) {
            return;
        }
        try {
            RxBus.get().unregister(subscriber);
        } catch (IllegalArgumentException e) {
//            BuglyWrapper.getInstance().postException(e);
        }
    }

    public static void post(Object event) {
        if (event == null) {
            return;
        }
        RxBus.get().post(event);
    }

    public static void post(String tag, Object event) {
        if (event == null) {
            return;
        }
        RxBus.get().post(tag, event);
    }

}
